package com.ccys.db.entity;

import com.ccys.db.rely.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
* Created by Mybatis Generator on 2023/12/15
*/
@Data
@ApiModel("Automated promotion code,迁移时注意 type 类型变化")
@Table(name = "tbl_promo_code_automated")
@NoArgsConstructor
@AllArgsConstructor
public class TblPromoCodeAutomated extends BaseEntity {
    /**
     * 0auto 1NRIC 2pre existing promo code
     */
    @Column(name = "generate_type")
    @ApiModelProperty("0auto 1NRIC 2pre existing promo code")
    private Integer generateType;

    /**
     * 0:free delivery(快递费用免费);1:fixed $ off bill(账单抵扣金额);2:% off bill(账单打折);3:fixed $ off consultation(问诊费用抵扣金额);4:% off consultation(问诊费用打折);5:fixed $ off delivery(快递费用抵扣金额);6:% off delivery(快递费用打折);7:%off consultation + % off delivery(问诊费用与快递费用同时打折)
     */
    @ApiModelProperty("0:free delivery(快递费用免费);1:fixed $ off bill(账单抵扣金额);2:% off bill(账单打折);3:fixed $ off consultation(问诊费用抵扣金额);4:% off consultation(问诊费用打折);5:fixed $ off delivery(快递费用抵扣金额);6:% off delivery(快递费用打折);7:%off consultation + % off delivery(问诊费用与快递费用同时打折)")
    private Integer type;

    @Column(name = "email_matching_pattern")
    private String emailMatchingPattern;

    private Integer status;

    private String prefix;

    /**
     * generate_type 为 2 时，存储-1
     */
    @Column(name = "generate_length")
    @ApiModelProperty("generate_type 为 2 时，存储-1")
    private Integer generateLength;

    @Column(name = "send_email")
    private Integer sendEmail;

    /**
     * Target receiver 0self 1dependent
     */
    @ApiModelProperty("Target receiver 0self 1dependent")
    private Integer receiver;

    @Column(name = "discount_label")
    private String discountLabel;

    /**
     * 使用限制 0 为无限
     */
    @Column(name = "limit_number")
    @ApiModelProperty("使用限制 0 为无限")
    private Integer limitNumber;

    /**
     * 0duration 1date
     */
    @Column(name = "end_type")
    @ApiModelProperty("0duration 1date")
    private Integer endType;

    /**
     * 持续时长(天)
     */
    @Column(name = "end_duration")
    @ApiModelProperty("持续时长(天)")
    private Integer endDuration;

    /**
     * 到期时间
     */
    @Column(name = "end_date")
    @ApiModelProperty("到期时间")
    private Date endDate;

    /**
     * 同一个人是否可重复使用
     */
    @ApiModelProperty("同一个人是否可重复使用")
    private Integer reusable;

    private BigDecimal amount;

    @Column(name = "used_number")
    private Integer usedNumber;

    /**
     * generate_type 为 2 是存储 code;原code_name
     */
    @ApiModelProperty("generate_type 为 2 是存储 code;原code_name")
    private String code;

    /**
     * 名称，原code_name_description
     */
    @ApiModelProperty("名称，原code_name_description")
    private String name;
}